/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * homeScreenFrame.java
 *
 * Created on Oct 14, 2011, 1:30:36 PM
 */
package odeoncinemaassignment;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author CantCatchMe
 */
public class homeScreenFrame extends javax.swing.JFrame {

    /** Creates new form homeScreenFrame */
    public homeScreenFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        odeonLogoLbl = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        administrationButtonPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        administrationBtn = new javax.swing.JButton();
        buttonSeperator = new javax.swing.JSeparator();
        buttonSeperator2 = new javax.swing.JSeparator();
        salesSystemPanel = new javax.swing.JPanel();
        salesSystemButton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        cashManagementPanel = new javax.swing.JPanel();
        cashManagementLabel = new javax.swing.JLabel();
        CashManagementButton = new javax.swing.JButton();
        homeScreenExitButton = new javax.swing.JButton();
        currentTime = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(0, 153, 153));

        odeonLogoLbl.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/odeon_logo.png"))); // NOI18N
        jPanel1.add(odeonLogoLbl);

        administrationButtonPanel.setLayout(new java.awt.BorderLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Add A Movie");
        jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        administrationButtonPanel.add(jLabel1, java.awt.BorderLayout.CENTER);

        administrationBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/film-reel.png"))); // NOI18N
        administrationBtn.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0), 2));
        administrationBtn.setBorderPainted(false);
        administrationBtn.setContentAreaFilled(false);
        administrationBtn.setOpaque(true);
        administrationBtn.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                administrationBtnMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                administrationBtnMouseExited(evt);
            }
        });
        administrationBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                administrationBtnActionPerformed(evt);
            }
        });
        administrationButtonPanel.add(administrationBtn, java.awt.BorderLayout.PAGE_START);

        jPanel2.add(administrationButtonPanel);
        jPanel2.add(buttonSeperator);
        jPanel2.add(buttonSeperator2);

        salesSystemPanel.setLayout(new java.awt.BorderLayout());

        salesSystemButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/moneyIcon_128x128.png"))); // NOI18N
        salesSystemButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0), 2));
        salesSystemButton.setBorderPainted(false);
        salesSystemButton.setContentAreaFilled(false);
        salesSystemButton.setOpaque(true);
        salesSystemButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                salesSystemButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                salesSystemButtonMouseExited(evt);
            }
        });
        salesSystemButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salesSystemButtonActionPerformed(evt);
            }
        });
        salesSystemPanel.add(salesSystemButton, java.awt.BorderLayout.CENTER);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Ticket Sales");
        jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel2.setMaximumSize(new java.awt.Dimension(106, 14));
        jLabel2.setMinimumSize(new java.awt.Dimension(106, 14));
        jLabel2.setPreferredSize(new java.awt.Dimension(106, 14));
        salesSystemPanel.add(jLabel2, java.awt.BorderLayout.PAGE_END);

        jPanel2.add(salesSystemPanel);

        cashManagementPanel.setLayout(new java.awt.BorderLayout());

        cashManagementLabel.setFont(new java.awt.Font("Tahoma", 1, 12));
        cashManagementLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        cashManagementLabel.setText("Sales Reports");
        cashManagementPanel.add(cashManagementLabel, java.awt.BorderLayout.PAGE_END);

        CashManagementButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Tools-128.png"))); // NOI18N
        CashManagementButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0), 2));
        CashManagementButton.setBorderPainted(false);
        CashManagementButton.setContentAreaFilled(false);
        CashManagementButton.setOpaque(true);
        CashManagementButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                CashManagementButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                CashManagementButtonMouseExited(evt);
            }
        });
        CashManagementButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CashManagementButtonActionPerformed(evt);
            }
        });
        cashManagementPanel.add(CashManagementButton, java.awt.BorderLayout.CENTER);

        jPanel2.add(cashManagementPanel);

        homeScreenExitButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/house.png"))); // NOI18N
        homeScreenExitButton.setText("Exit");
        homeScreenExitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeScreenExitButtonActionPerformed(evt);
            }
        });

        currentTime.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        currentTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(currentTime, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(homeScreenExitButton)
                            .addContainerGap())
                        .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 1036, Short.MAX_VALUE)
                            .addContainerGap()))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(currentTime, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 434, Short.MAX_VALUE)
                .addComponent(homeScreenExitButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void administrationBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_administrationBtnActionPerformed
        try {
            adminFrame newAdminFrame = new adminFrame(); //set it visible
            newAdminFrame.setVisible(true); //set it visible
        } catch (SQLException ex) {
            Logger.getLogger(homeScreenFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }//GEN-LAST:event_administrationBtnActionPerformed

    private void homeScreenExitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeScreenExitButtonActionPerformed
        utilities.exitApp(); // calls the exit app code from utilities class
    }//GEN-LAST:event_homeScreenExitButtonActionPerformed

    private void administrationBtnMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_administrationBtnMouseEntered
        administrationBtn.setBorderPainted(true);
    }//GEN-LAST:event_administrationBtnMouseEntered

    private void administrationBtnMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_administrationBtnMouseExited
        administrationBtn.setBorderPainted(false);
    }//GEN-LAST:event_administrationBtnMouseExited

    private void salesSystemButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salesSystemButtonMouseEntered
        salesSystemButton.setBorderPainted(true);
    }//GEN-LAST:event_salesSystemButtonMouseEntered

    private void salesSystemButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salesSystemButtonMouseExited
        salesSystemButton.setBorderPainted(false);
    }//GEN-LAST:event_salesSystemButtonMouseExited

    private void salesSystemButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salesSystemButtonActionPerformed
        try {
            retailFrame newRetailFrame = new retailFrame(); //create instance of frame called newFrame
            newRetailFrame.setVisible(true); //set titles entereed to list in retail frame
        } catch (SQLException ex) {
            Logger.getLogger(homeScreenFrame.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_salesSystemButtonActionPerformed

    private void CashManagementButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CashManagementButtonActionPerformed
       salesReport newSalesReportFrame = new salesReport(); //create instance of frame called newFrame
        newSalesReportFrame.setVisible(true); //set it visible
    }//GEN-LAST:event_CashManagementButtonActionPerformed

    private void CashManagementButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CashManagementButtonMouseEntered
       CashManagementButton.setBorderPainted(true);
    }//GEN-LAST:event_CashManagementButtonMouseEntered

    private void CashManagementButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CashManagementButtonMouseExited
       CashManagementButton.setBorderPainted(false); 
    }//GEN-LAST:event_CashManagementButtonMouseExited

//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(homeScreenFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(homeScreenFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(homeScreenFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(homeScreenFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new homeScreenFrame().setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton CashManagementButton;
    private javax.swing.JButton administrationBtn;
    private javax.swing.JPanel administrationButtonPanel;
    private javax.swing.JSeparator buttonSeperator;
    private javax.swing.JSeparator buttonSeperator2;
    private javax.swing.JLabel cashManagementLabel;
    private javax.swing.JPanel cashManagementPanel;
    public static javax.swing.JLabel currentTime;
    private javax.swing.JButton homeScreenExitButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel odeonLogoLbl;
    private javax.swing.JButton salesSystemButton;
    private javax.swing.JPanel salesSystemPanel;
    // End of variables declaration//GEN-END:variables
}